
module testbench; 
    
    class myc; 
        int a=0;
        int b;
        int id=0;
        static int id_cnt=0; 
        function new();
            a=1;
            b=2;
            id = id_cnt++;
        endfunction
        function void display();    
            $display("a=%0d b=%0d id=%0d id_cnt=%0d",a,b,id,id_cnt); 
        endfunction 

    endclass
    
    myc c1;
    myc c2;

    initial begin
        $display("\033[32m\t\t!!\tcode begin\t!!");  
        c1=new();
        c2=new();//c2=new(c1)
        
        c1.display();
        c2.b=100;
        c1.display();
        c2.display();
        
        $display(myc::id_cnt);
    
    
        $display("\t\t!!\tcode end\t!!\033[0m");
        $finish; 
    end 
endmodule 